package com.hooper.hosp.controller;

import com.hooper.hosp.service.OosService;
import com.hooper.hospital.common.result.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/10/07/15:45
 */
@RequiredArgsConstructor
@Slf4j
@RestController
@RequestMapping("/api/oos/file")
public class OosApiController {
    private final OosService oosService;


    @PostMapping("/fileUpload")
    public Result<String> upload(MultipartFile file){
        String imgUrl = oosService.upload(file);
        return Result.ok(imgUrl);
    }
}
